<template>
    <div  >
        <el-card  shadow="hover">
            <div slot="header" class="clearfix">
                <span>语言详情</span>
            </div>
        vue{{perc+1}}  <!-- 测试父控件得属性值 -->
        <el-button  @click="cktest" >测试</el-button>
        <el-progress  :percentage="bfb"  color="#022612" ></el-progress>
        </el-card>

    </div>
</template>


<script>
import { mapState } from "vuex";
export default {
  name: "PartCard",
  data: function() {
    return {
      percent: 60,
      name: "ss"
    };
    32;
  },
  props: ["perc"],
  methods: {
    cktest() {
      //测试父控件方法
      this.$emit("testParentMethod");
      //父控件得data
      this.percent = this.percent + this.perc;
    }
  },
  computed: {
    //这里的三点叫做 : 扩展运算符
    bfb() {
      console.log("test", this.$store.state.myuStore.percent);
      return this.$store.state.myuStore.percent;
    }

    // ...mapState({
    //   show:state=>state.myuStore.show
    // }),

    // ...mapState({
    //   show:state=>state.myuStore.show
    // }),
  }
};
</script>